package FTP;

import cn.hutool.extra.ftp.Ftp;
import cn.hutool.extra.ftp.FtpMode;

import java.nio.charset.Charset;

/**
 * @author LHB
 * @date 2019/11/19 17:43
 */
public class FtpClient {

    public static Ftp ftp;
    /**
     * ip
     */
    private String host;
    /**
     * port
     */
    private Integer port;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    private String password;
    private Charset charset;
    private FtpMode ftpMode;


    public FtpClient(String host) {
        if (ftp == null) {
            ftp = new Ftp(host);
        }
    }

    public FtpClient(String host, int port) {
        if (ftp == null) {
            ftp = new Ftp(host, port);
        }
    }

    public FtpClient(String host, int port, String user, String password) {
        if (ftp == null) {
            ftp = new Ftp(host, port, user, password);
        }
    }

    public FtpClient(String host, int port, String user, String password, Charset charset) {
        if (ftp == null) {
            ftp = new Ftp(host, port, user, password, charset);
        }
    }

    public FtpClient(String host, int port, String user, String password, Charset charset, FtpMode mode) {
        if (ftp == null) {
            ftp = new Ftp(host, port, user, password, charset, mode);
        }
    }


//==================================================================================================================


    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }



    public Charset getCharset() {
        return charset;
    }

    public void setCharset(Charset charset) {
        this.charset = charset;
    }

    public FtpMode getFtpMode() {
        return ftpMode;
    }

    public void setFtpMode(FtpMode ftpMode) {
        this.ftpMode = ftpMode;
    }
}
